# I2C驱动测试构建文件

if meson_build
    message('meson build drivers')
    drivers_install_dir = meson.project_build_root() / 'opt/bmc/drivers'
else
    message('bingo build drivers')
    drivers_install_dir = 'opt/bmc/drivers/'
endif
run_command('mkdir', '-p', drivers_install_dir, check: false)

# ABI测试 - 直接包含接口实现文件以确保反射元数据可用
i2c_test_sources = [
    '../../../main.cpp',
    'test_i2c_abi.cpp',
    '../../../../drivers/bus/i2c/interface/i_i2c.cpp',
]

i2c_test = executable(
    'test_i2c_abi',
    i2c_test_sources,
    include_directories: [
        include_dirs,
        '../../../../drivers/bus/i2c',
        '../../../../drivers/internal',
    ],
    dependencies: [
        gtest_dep,
        test_utilities_dep,
        libmcpp_deps,
        internal_dep,
        test_utils_dep,
    ],
    link_args: ['-Wl,-rpath,' + meson.project_build_root() + '/opt/bmc/drivers'],
)
test('test_i2c_abi', i2c_test, timeout: 300, suite: 'i2c')